﻿@model TechnicBlog.Models.UserEntity
@{
    Layout = null;
}

<script>
    function RequestError() {
        $.messager.alert('错误', '<br>请求失败！', 'error');
    }
    function checkSubmit() {
        if ($("#form0").validate()) {
            $('#loading').window('open');
            $("#form0").ajaxSubmit({ action: this.action, method: this.method });
        }
    }
</script>
@*@using (Ajax.BeginForm("Add", new AjaxOptions()
{
    //HttpMethod = "Post",
    //LoadingElementId = "loading",
    //OnBegin = "commentValidate",
    OnFailure = "RequestError",
    //OnSuccess = "test",
    //UpdateTargetId = "myPnl"
    //UpdateTargetId = "boxcomments",
    //InsertionMode = InsertionMode.Replace
})
)
{*@
<form id="form0" action="/User/Edit" method="post" data-ajax-failure="RequestError"
data-ajax="true">
<fieldset>
    <legend>UserEntity</legend>
    @Html.HiddenFor(model => model.UserId)
    <table style="color: #666666; width: 100%;">
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                登录名：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.LoginName, new { @readonly="readonly", require = "true", regexp = "^[A-Za-z0-9_]+$|只能输入英文字母、数字和下划线" })
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                用户名：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.UserName, new { require = "true" })
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                性别：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.DropDownList("Sex", new[] { new SelectListItem { Text = "男", Value = "1" }, new SelectListItem { Text = "女", Value = "0" } }, new { style = "width:155px" })
                    @*@Html.EditorFor(model => model.Sex)*@
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                手机：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Mobile, new {mobile="true" })
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                邮箱：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Email, new { email = "true"})
                    @* @Html.ValidationMessageFor(model => model.Email)*@
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                QQ：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.QQ)
                </div>
            </td>
        </tr>
        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                地址：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.EditorFor(model => model.Address)
                </div>
            </td>
        </tr>
@*        <tr style="height: 28px;">
            <td style="width: 20%;" align="right">
                描述：
            </td>
            <td style="width: 80%;" align="left">
                <div class="editor-field">
                    @Html.EditorFor(model => model.remarks[0].Remark)
                </div>
            </td>
        </tr>*@
        <tr>
            <td>
            </td>
            <td>
                <a class="easyui-linkbutton"
                    iconcls="icon-save" onclick="return checkSubmit();">提交</a>
            </td>
        </tr>
    </table>
</fieldset>
</form>
@*}*@
